<div class="content-wrapper">

    <section class="content-header">
        <?php echo $this->partial('layout/breadcrumb'); ?>

        <h1 class="pull-right">
            <a href="<?php echo $this->url('navigation', ['action'=> 'add']);?>" class="btn btn-primary btn-sm"><i class="fa fa-plus"></i> <?php echo $this->translate('添加导航'); ?></a>
            <?php echo $this->HelpUrl('navigationList'); ?>
        </h1>

    </section>

    <section class="content">
        <?php echo $this->partial('layout/messages'); ?>

        <div class="row">
            <div class="col-xs-12">
                <div class="box shop-box">

                    <div class="box-body table-responsive no-padding">
                        <table class="table table-hover">
                            <thead>
                            <tr class="shop-bg-thead">
                                <th width="5%">ID</th>
                                <th width="20%"><?php echo $this->translate('导航标题'); ?></th>
                                <th width="35%"><?php echo $this->translate('导航地址'); ?></th>
                                <th width="10%"><?php echo $this->translate('位置'); ?></th>
                                <th width="9%"><?php echo $this->translate('新窗口'); ?></th>
                                <th width="9%"><?php echo $this->translate('排序'); ?></th>
                                <th width="12%"><?php echo $this->translate('操作'); ?></th>
                            </tr>
                            </thead>
                            <tbody>
                            <?php $placeArray = [1 => $this->translate('顶部'), 2 => $this->translate('中部'), 3 => $this->translate('底部')];
                            if ($this->navigationList) foreach ($this->navigationList as $value) { ?>
                                <tr>
                                    <td><?php echo $value->getNavigationId(); ?></td>
                                    <td><?php echo $this->escapeHtml($value->getNavigationTitle()); ?></td>
                                    <td><?php echo $this->escapeHtml($value->getNavigationUrl()); ?></td>
                                    <td><?php echo $placeArray[$value->getNavigationPlace()]; ?></td>
                                    <td><?php echo $value->getNewWindow() == 1 ? $this->translate('是') : $this->translate('否'); ?></td>
                                    <td><?php echo $value->getNavigationSort(); ?></td>
                                    <td>
                                        <a href="<?php echo $this->url('navigation',
                                            ['action' => 'edit', 'id' => $value->getNavigationId()]); ?>"
                                           class="btn btn-xs btn-success"><i class="fa fa-pencil"></i> <?php echo $this->translate('编辑'); ?></a>

                                        <a href="javascript:;" onclick="deleteConfirm('<?php echo $this->translate('您确实要删除该导航吗?'); ?>', '<?php echo $this->url('navigation', ['action'=>'delete', 'id' => $value->getNavigationId()], ['query' => ['qToken' => $this->adminHelper()->getCsrfValue()]]); ?>');" class="btn btn-xs btn-danger"><i class="fa fa-trash"></i> <?php echo $this->translate('删除'); ?></a>
                                    </td>
                                </tr>
                            <?php } ?>
                            </tbody>
                        </table>
                    </div>

                </div>

            </div>
        </div>

    </section>
</div>